<%@page import="com.mmy.domain.sys.TSysUser"%>
<!-- 引入公司 -->
<%@page import="com.mmy.domain.sys.TSysOrg"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>  
 <%
 	TSysUser tSysUser = (TSysUser)session.getAttribute("tSysUser");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<jsp:include page="/WEB-INF/jsp/includeb.jsp"></jsp:include>
<script type="text/javascript" src="js/jsp/back/staff/staffIndex.js"></script>

<title>用户信息</title>
	</head>
	<body>
		<div id="off-canvas-container" class="off-canvas-container">
		<jsp:include page="/WEB-INF/jsp/BackHeader.jsp"></jsp:include>
		
			<div id="menu-back">
			<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
		<!-- Main Start -->
		<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
		<main class="at-padding-large-bottom">
			<article>
				<header class="bg-light at-padding-large-top at-padding-large-bottom at-margin-large-bottom">
					<div class="page-header container">
						<div class="row">
							<div class="span-5 col">
								<h1>用户资料管理</h1>
							</div>	
							
						 </div >
					</div>
				</header>
				<section class="container">
					
					
					<!-- 新建用户信息 -->
					<div class="information" >
					<form  action="backsavecreatestaff" class="info-form" name="staffForm" method="post" onSubmit="return staffSubmit(this);">
						<h4 class="info-h4">
							<i class="fa fa-caret-right" aria-hidden="true" ></i>新建用户信息
						</h4>
					<div class="input-container">
					<table class="info-table" >
				
				<tr>
					<th style="width: 15%;"><label for="staffName">用户姓名</label><span class="mustWrite">*</span></th>
					<td colspan="2">
						<input type="text" id="staffName" name="UserName" required="required"/>
					</td>
					<th><label for="staffSex">性别</label><span class="mustWrite">*</span></th>
					<td colspan="2">
							<select class="input-select-vlign"  id="staffSex" name="Sex" required="required">
							<option value="">--请选择--</option>
								<option value="0">男</option>
								<option value="1">女</option>
								
					</select>
					</td>
					
					
				</tr>
				<tr >
<th><label for="staffIdentity">身份证号</label><span class="mustWrite">*</span></th>
					<td colspan="2" >
						<input type="text" id="staffIdentity"  name="Identity" required="required" onblur="ckIdentity(this.value)"/>
						<input type="radio" name="isPass" >是否通过验证</input>
					</td>
					<th><label for="staffMobile">手机号码</label><span class="mustWrite">*</span></th>
					<td colspan="2">
						<input type="number" id="staffMobile"  name="UserMobile" required="required" onblur="ckMobile(this.value)"/>
					</td>
					
				</tr>
				<tr>
				<th><label for="staffType">用户类型</label><span class="mustWrite">*</span> </th>
					<td >
						<select class="input-select-vlign"  id="staffType"  name="UserType" required="required">
								<option  value="">--请选择--</option>
								<option  value="1">员工</option>
								<option value="2">导游</option>
								<option value="3">司机</option>
								<option value="4">主播</option>
							</select> 
					</td>
					<th><label for="staffOrg">所属公司名称</label><span class="mustWrite">*</span> </th>
					<td > 
					<!--判断登录人是否为超级管理员 显示所有公司  -->
					<c:choose>
					<c:when test="${tSysUser.getUserID()==0 }">
					<select class="input-select-vlign"  id="staffOrg"  name="OrgID" required="required" onChange="showUpUserID(this.value)">
					
								<option value="">--请选择--</option>
								<c:forEach var="lstSysOrg" items="${lstSysOrg}">
								<option value="${lstSysOrg.getOrgID()}">${lstSysOrg.getOrgName()}</option>
							</c:forEach>
						</select>
					</c:when>
					<c:otherwise>
					<!-- 非超级管理员登陆 只显示自己公司 -->
						<input type="text" id="staffOrg"  name="OrgID" value="${dbSysOrg.getOrgName() }" readonly="readonly"/>
					</c:otherwise>
					</c:choose>
					
					</td>
					
					<th><label for="staffUp">推荐人编码</label><span class="mustWrite">*</span></th>
					<td>
					<select class="input-select-vlign"  id="staffUp"  name="UpUserID" required="required" >
					
								<option value="">--请选择--</option>
								<c:forEach var="lstSysUser" items="${lstSysUser}">
								<option value="${lstSysUser.getUserID()}"  <c:if test="${lstSysUser.getUserID()==tSysUser.getUserID()}"> selected="selected"</c:if>>${lstSysUser.getUserID()}${lstSysUser.getUserName()}</option>
							</c:forEach>
						</select>
						</td> 
				</tr>
				
				<tr>
					<th><label for="staffMail">邮箱</label><span class="mustWrite">*</span> </th>
					<td >
						<input type="text"  id="staffMail" name="Mail" required="required" onblur="ckMail(this.value)"/>
					</td>
					<th><label for="staffTel">固定电话</label></th>
					<td >
						<input type="text" id="staffTel"  name="Tel"/>	 
					</td>
					<th><label for="staffFax">传真</label></th>
					<td >
						<input type="text" id="staffFax"  name="Fax"/>	 
					</td>
					
					
				</tr>
				
				<tr>
					
					<th><label for="staffJob">职位</label><span class="mustWrite">*</span> </th>
					<td >
						<input type="text" id="staffJob"  name="Job" required="required"/>	 
					</td>
					  <th><label for="up_img_WU_FILE_0">上传证件照片及个人照片</label> <span class="mustWrite">*</span> </th>
					
						  <td colspan="3">
					<!-- 	<input  id="staffCade" type="file" name="CadePath" required="required"/> -->
					
						<ul id="warp">
						  <li>
						证件照：
  							  <input type="file" id="up_img_WU_FILE_0" name="fCadeImg" required="required" />
   							 <img id="imgShow_WU_FILE_0" width="100" height="100" />
  							
  							</li>
 
 						 <li>							
					<!-- 	<input  id="staffPhoto" type="file" name="PhotoPath"/>  -->
					
    					个人照：	<input type="file" id="up_img_WU_FILE_1"  name="fPhotoImg"/>
  							  <img id="imgShow_WU_FILE_1" width="100" height="100" />
  							
 						 </li>
						</ul>	
					</td>
				</tr>
				<tr>
					
					<th><label for="staffVip">是否为VIP</label>
					</th>
					<td colspan="2">
					<input   type="radio"  name="VIP" value="0" id="staffVip0" checked/><label  for="staffVip0">否</label>
						<input  type="radio"  name="VIP" value="1" id="staffVip1" /><label for="staffVip1">是</label>
					
						</td>
					<th><label for="staffBlack">是否为黑名单</label></th>
					<td colspan="2">
					<input   type="radio"  name="Black" value="0" id="staffBlack0" checked/><label  for="staffBlack0">否</label>
						<input  type="radio"  name="Black" value="1" id="staffBlack1" /><label for="staffBlack1">是</label>
						</td>
					
				</tr>
				<tr>
					<th><label for="staffAccountState">账号状态</label></th>
					<td colspan="2">
					<input   type="radio"  name="AccountState" value="0" id="staffAccountState0" checked/><label  for="staffAccountState0">正常</label>
						<input  type="radio"  name="AccountState" value="1" id="staffAccountState1" /><label for="staffAccountState1">禁用</label>
					</td>
					<th><label for="staffState">会员状态</label></th>
					<td colspan="2">
					<input   type="radio"  name="MemberState" value="0" id="staffMemberState0" checked/><label  for="staffMemberState0">普通账号</label>
						<input  type="radio"  name="MemberState" value="1" id="staffMemberState1" /><label for="staffMemberState1">会员账号</label>
					</td>
				</tr>
			
				<tr>
					<th><label for="staffMemo">备注</label></th>
					<td colspan="5">
						<textarea  id="staffMemo"  name="Memo"></textarea>
					</td>
					
				</tr>
				 <tr>
					<th><input type="checkbox" id="ckall" name="ckall" onclick="ckAll(this);"><label for="staffRole">角色</label></th>
					<td colspan="5">
					<c:forEach items="${lstConstRole}" var="lstConstRole" varStatus="status">
					<span class="newspan-2 col" style="text-align: left;">
<input type="checkbox"  id="staffRole${status.index }" name="ckone" value="${lstConstRole.getRoleID()}" onclick="ckOne(this)" >
<label for="StaffRole${status.index }">${lstConstRole.getRoleName()}</label>

</span>
</c:forEach>
					</td>
					
				</tr> 
			</table>
			
			<center>
				<input type="submit" class="btn" value="保存" />
				<input type="button" class="btn" value="返回" onclick="rehidder()"/>
			</center> 
			</div>
			</form>
			</div>
			</section>
			</article>
			</main>
</div>
		<jsp:include page="/WEB-INF/jsp/Footer.jsp"></jsp:include>
	</div>
	
		<jsp:include page="/WEB-INF/jsp/include2.jsp"></jsp:include>

</body>

</html>